package com.wh.mail_demo;

import com.wh.mail_demo.service.MailService;
import lombok.SneakyThrows;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.io.File;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = MailDemoApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class sendMail {
    @Resource
    MailService mailService;
    @SneakyThrows
    @Test
    public void sendSimpleMail(){
        mailService.sendSimpleMail("wh508377132@163.com","508377132@qq.com","508377132@qq.com","重要通知","FOREST公司邀请你面试,GO GO","王欢");
    }
    @Test
    public void  sendAttachFileMail(){
        mailService.sendAttachFileMail("wh508377132@163.com","508377132@qq.com","美女","lll",new File("D:\\girl.jpg"));
    }

}
